/**
 * Created by JinMiao
 * 2017/7/5.
 */
public class JavaCallKotlin {

    private int a;

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public static void main(String[] args) {
        for(int i =0;i<100;i++)
            test(false);
        test(true);



    }


    public static void test(boolean print){
        long start = System.currentTimeMillis();
        for(int i =0;i<1000000;i++){
            KotlinCallJava kotlinCallJava = new KotlinCallJava();
            kotlinCallJava.setA(55);
        }
        if(print)
         System.out.println(System.currentTimeMillis()-start);

        start = System.currentTimeMillis();
        for(int i =0;i<1000000;i++){
            JavaCallKotlin kotlinCallJava = new JavaCallKotlin();
            kotlinCallJava.setA(55);
        }
        if(print)
           System.out.println(System.currentTimeMillis()-start);

    }
}
